Editor
Built to provide versatile photo and video editing capabilities. Toggling between edit, preview and pages modes enables users to evaluate their edited photos/videos before export.
Parameters
the license to activate the ly.img.engine.Engine with.
an optional unique ID tied to your application's user. This helps us accurately calculate monthly active users (MAU). Especially useful when one person uses the app on multiple devices with a sign-in feature, ensuring they're counted once. Providing this aids in better data accuracy.
the base Uri that is used to construct absolute paths from relative paths. absolutePath = baseUri + relativePath. For instance, baseUri can be set to android assets: file:///android_asset/. After setting this path you can, for instance, load example.scene from assets/scenes folder using relative path: engine.scene.load(sceneUri = Uri.parse("scenes/example.scene")) Default value is defaultBaseUri.
the target which should be used by the ly.img.engine.Engine to render. Default value is EngineRenderTarget.SURFACE_VIEW.
the configuration object of the editor. Check EditorConfiguration.Companion.remember documentation on how to create and configure the object. Note that this parameter is optional. The default behavior is specified in EditorConfiguration.Companion.remember. IMPORTANT: EditorConfiguration should only be created inside configuration composable lambda, otherwise crashes may occur.
the callback that is invoked when the editor is closed. Here are some of the recommended implementations:
activity.finish() if the editor is launched in a standalone activity.
fragmentManager.popBackStack() if the editor is launched in a fragment.
navController.popBackStack() if the editor is launched as a new composable destination in NavHost. If the optional parameter Throwable is not null, it means that the editor is closed due to an error. The value is propagated from ly.img.editor.core.event.EditorEvent.CloseEditor. Unless custom types are sent to this function, the throwable is always going to be either an EditorException or ly.img.engine.EngineException.